import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "@/plugins/element";
import directive from "@/common/directive";
Vue.config.productionTip = false;

import BaiduMap from "vue-baidu-map";

Vue.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
  ak: "dUycbxsGx24if6NFSeYGU7bgrlsjMRTk",
});
Vue.use(directive);
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");

/* function sleep(ms) {
  return new Promise((resolve) => {
    setTimeout(resolve, ms);
  });
}

async function main() {
  console.log("开始睡眠");
  const list = [1, 2, 3, 4];
  for (const message of list) {
    await roomSendMessage(message);
  }
  await sleep(6000); // 等待 1 分钟，即 60 秒，注意参数单位为毫秒
  console.log("睡眠结束");
  main();
}
async function roomSendMessage(message) {
  await getData(message);
}

function getData(message) {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve();
      console.log(message);
    }, 2000);
  });
} */

//main();
